#!/bin/bash
#使用华为云的镜像

version="7.6.1"

mkdir -p /data/tools
cd /data/tools

package_url="https://mirrors.huaweicloud.com/logstash/${version}/logstash-${version}.zip"

wget -c ${package_url} || exit 1

yum install -y unzip
unzip logstash-${version}.zip

ln -sf logstash-${version} logstash
mkdir -p /data/tools/logstash/logs
mkdir -p /data/sh
ln /data/tools/logstash/bin/logstash /data/sh/logstash

echo ""
echo ""
echo "logstash install success! You can custom yml config file,eg:logstash-es.conf 。Then run comman: sh /data/tools/logstash/bin/logstash  -f logstash-es.conf"
echo "If you wants alway running ,Then run comman: nohup  sh /data/tools/logstash/bin/logstash  -f logstash-es.conf 2>&1 &"

